Amiga Active list (698/1044)

From:Matt
Date:21 Sep 2001 at 21:01:54
Subject:[amigactive] Floating Point -> Fixed Point conversion

Hi,

Argh! I have a stupid problem in coding, in that I lost the nifty macro
that converts from a floating point to a fixed point (16 bit whole part,
16 bit fraction) number! It was so simple yet so forgettable!

I basically need this little snippet of code and was wondering if anyone
actually knew how to do it?

It's something like

#define ToFixed(n) ( ((float)n) * (1<< 16) )

but that isn't it (I don't think..)

Regards



Matt

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE VeriSign guide to security solutions for your web site: encrypting transactions, securing intranets, and more!
http://us.click.yahoo.com/XrFcOC/m5_CAA/yigFAA/dpFolB/TM
---------------------------------------------------------------------~->

Quote carefully and read all ADMIN:README mails
To unsubscribe mailto:amigactive-unsubscribe@yahoogroups.com
Anyone sending unsubscribe messages to the list will be SHOT!

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/